#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N], b[N], c[N];
int pos[N], l[505], r[505];
void init_inb(int x) {
  per(i, r[x], l[x]) {
    b[i] = i + a[i];
    c[i] = 1;
    if (b[i] <= r[x]) {
      c[i] += c[b[i]];
      b[i] = b[b[i]];
    }
  }
}
void init() {
  int k = sqrt(n);
  rep(i, 1, n) pos[i] = (i - 1) / k + 1;
  int cnt = pos[n];
  rep(i, 1, cnt) {
    l[i] = (i - 1) * k + 1;
    r[i] = i * k;
  }
  r[cnt] = n;
  rep(i, 1, cnt) init_inb(i);
}
void update(int x, int y) {
  a[x] = y;
  init_inb(pos[x]);
}
int query(int x) {
  int res = 0;
  while (x <= n) {
    res += c[x];
    x = b[x];
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) cin >> a[i];
  init();
  cin >> m;
  while (m--) {
    int op, x, y;
    cin >> op >> x;
    x++;
    if (op == 1) {
      cout << query(x) << endl;
    } else {
      cin >> y;
      update(x, y);
    }
  }
  return 0;
}